package com.ccys.app.controller;

import com.ccys.app.service.DeliveryAddressInfoService;
import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.dto.app.updateAddressScreen.DeleteDeliveryAddressDto;
import com.ccys.db.dto.app.updateAddressScreen.UpdateDeliveryAddressInfoDto;
import com.ccys.db.vo.app.updateAddressScreen.UpdateDeliveryAddressInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: WhiteCoat
 * @description: 快递地址详细信息接口
 * @author: ZhangJingCan
 * @create: 2024-01-30 13:10
 **/

@RestController
@Api(tags = "进入屏幕时")
@RequestMapping("deliveryAddressInfo")
public class DeliveryAddressInfoController {

    @Autowired
    private DeliveryAddressInfoService deliveryAddressInfoService;

    @ApiOperation("修改快递地址详细信息并返回修改后的信息")
    @PostMapping(value = "/UpdateDeliveryAddressInfo")
    public ResponseResultApp<UpdateDeliveryAddressInfoVo> updateDeliveryAddressInfo(@RequestBody UpdateDeliveryAddressInfoDto dto) {
        return deliveryAddressInfoService.updateDeliveryAddressInfo(dto);
    }

    @ApiOperation("根据ID删除快递信息数据")
    @PostMapping(value = "/DeleteDeliveryAddress")
    public ResponseResultApp deleteDeliveryAddress(@RequestBody DeleteDeliveryAddressDto dto) {
        return deliveryAddressInfoService.deleteDeliveryAddress(dto);
    }

}
